package com.mproject.customclass;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Locale;

import android.text.format.DateFormat;

public class Project implements Serializable{

	private String ID;
	private String openDate;
	private String expiryDate;
	private String title;
	private String description;
	private String category;
	private boolean isManager;
	private List<Student> managers;
	private List<Student> members;
	private int noManagers;
	private int noMembers;
	
	private static final String dateTemplate = "yyyy-MM-dd";
	private final DateFormat dateFormatter = new DateFormat();

	public Project (String ID, String openDate, String expiryDate) {
		this.ID = ID;
		managers = new ArrayList<Student>();
		members = new ArrayList<Student>();
		Calendar calendar = Calendar.getInstance(Locale.getDefault());
		calendar.setTimeInMillis(Long.parseLong(openDate));
		this.setOpenDate(dateFormatter.format(dateTemplate, calendar.getTime()).toString());
		calendar.setTimeInMillis(Long.parseLong(expiryDate));
		this.setExpiryDate(dateFormatter.format(dateTemplate, calendar.getTime()).toString());
	}
	
	public Project (String ID) {
		this.ID = ID;
		managers = new ArrayList<Student>();
		members = new ArrayList<Student>();
	}
	/**
	 * @return the name
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * @param name the name to set
	 */
	public void setTitle(String name) {
		this.title = name;
	}

	/**
	 * @return the isManager
	 */
	public boolean isManager() {
		return isManager;
	}

	/**
	 * @param isManager the isManager to set
	 */
	public void setManager(boolean isManager) {
		this.isManager = isManager;
	}

	/**
	 * @return the iD
	 */
	public String getID() {
		return ID;
	}

	/**
	 * @param iD the iD to set
	 */
	public void setID(String iD) {
		ID = iD;
	}
	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}
	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}
	/**
	 * @return the category
	 */
	public String getCategory() {
		return category;
	}
	/**
	 * @param category the category to set
	 */
	public void setCategory(String category) {
		this.category = category;
	}
	/**
	 * @return the members
	 */
	public List<Student> getMembers() {
		return members;
	}
	/**
	 * @param members the members to set
	 */
	public void setMembers(List<Student> members) {
		this.members = members;
	}
	/**
	 * @return the managers
	 */
	public List<Student> getManagers() {
		return managers;
	}
	/**
	 * @param managers the managers to set
	 */
	public void setManagers(List<Student> managers) {
		this.managers = managers;
	}
	/**
	 * @return the noManagers
	 */
	public int getNoManagers() {
		return noManagers;
	}
	/**
	 * @param noManagers the noManagers to set
	 */
	public void setNoManagers(int noManagers) {
		this.noManagers = noManagers;
	}
	/**
	 * @return the noMembers
	 */
	public int getNoMembers() {
		return noMembers;
	}
	/**
	 * @param noMembers the noMembers to set
	 */
	public void setNoMembers(int noMembers) {
		this.noMembers = noMembers;
	}

	/**
	 * @return the openDate
	 */
	public String getOpenDate() {
		return openDate;
	}

	/**
	 * @param openDate the openDate to set
	 */
	public void setOpenDate(String openDate) {
		this.openDate = openDate;
	}

	/**
	 * @return the expiryDate
	 */
	public String getExpiryDate() {
		return expiryDate;
	}

	/**
	 * @param expiryDate the expiryDate to set
	 */
	public void setExpiryDate(String expiryDate) {
		this.expiryDate = expiryDate;
	}

}
